STATEMENT:  while

while

The while statement creates a loop consisting of a block of statements that is executed if the expression evaluated is true.

The following example simply counts 1 thru 10 by incrementing a counter by 1 each time for as long as the counter is less than 11:

Code:
var i = 0;
while(i<11)
{
   document.write(i + "<BR>");
   i++;
}

Copyright 2000 by Infinite Software Solutions, Inc.
Trademark Information